#include "sys_ext.h"
//#include "os_obj.h"

TX_INTERRUPT_SAVE_AREA;

/*******************************************************************************
* @brief  os_lock
* \param[in] none
* \retval: none
*******************************************************************************/
void os_lock(void)
{
    //osKernelLock();
    TX_DISABLE;
}

/*******************************************************************************
* @brief  os_unlock
* \param[in] none
* \retval: none
*******************************************************************************/
void os_unlock(void)
{
    //osKernelUnlock();
    TX_RESTORE;
}

/*******************************************************************************
* @brief  nvic_irq_set
* \param[in] IRQn
* \param[in] priority
* \param[in] newst 0-disable, other-enable
* \retval: none
*******************************************************************************/
void nvic_irq_set(IRQn_Type IRQn, uint32_t priority, uint8_t newst)
{
    intx_alloc();
    
    /* disable interrupt */
    intx_disable();
    
    if(newst)
    {
        NVIC_SetPriority(IRQn, priority);
        NVIC_ClearPendingIRQ(IRQn);
        NVIC_EnableIRQ(IRQn);
    }
    else
    {
        NVIC_DisableIRQ(IRQn);
    }
    
    intx_enable();
}

